Skip to content

Comments

Backport XML documentation for CustomReflectionContext#124365

Open
Copilot wants to merge 8 commits intomainfrom
copilot/backport-customreflectioncontext-docs
Open

Backport XML documentation for CustomReflectionContext#124365
Copilot wants to merge 8 commits intomainfrom
copilot/backport-customreflectioncontext-docs

Conversation

Copy link
Contributor

Copilot AI commented Feb 13, 2026

Description

Backports XML documentation from dotnet-api-docs to the runtime repository per #124227.

Changes:

  • Added XML documentation to CustomReflectionContext class in src assembly with summary and simplified type-level remarks
  • Added summary, param/return documentation, and short member-level remarks to all public/protected members in src assembly
  • Type-level remarks in src include only a link to supplemental documentation: https://github.com/dotnet/docs/raw/main/docs/fundamentals/runtime-libraries/system-reflection-context-customreflectioncontext.md
  • Member-level remarks provide brief contextual information (e.g., usage guidance for AddProperties and CreateProperty methods)
  • Removed UseCompilerGeneratedDocXmlFile=false from csproj to enable compiler-generated XML documentation files
  • Added <NoWarn>$(NoWarn);CS1591</NoWarn> to suppress missing XML documentation warnings in generated platform-not-supported stubs
  • Ref assembly contains no XML documentation per established guidelines

Customer Impact

Developers using System.Reflection.Context will have IntelliSense documentation with summaries, parameter descriptions, and brief contextual remarks for all members, plus a link to comprehensive documentation showing how to customize reflection behavior through attribute manipulation and virtual properties.

Regression

No. Documentation-only change.

Testing

  • Built successfully for all target frameworks (netstandard2.0, netstandard2.1, net10.0)
  • XML documentation compiles without errors
  • Compiler-generated XML documentation files are created successfully from src assembly
  • Code review passed

Risk

Minimal. Documentation-only change with no runtime impact.


💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.

Copilot AI and others added 2 commits February 13, 2026 01:09
Co-authored-by: gewarren <24882762+gewarren@users.noreply.github.com>
Co-authored-by: gewarren <24882762+gewarren@users.noreply.github.com>
@dotnet-policy-service
Copy link
Contributor

Tagging subscribers to this area: @dotnet/area-system-reflection
See info in area-owners.md if you want to be subscribed.

Copilot AI changed the title [WIP] Backport documentation for CustomReflectionContext Backport XML documentation for CustomReflectionContext Feb 13, 2026
Copilot AI requested a review from gewarren February 13, 2026 01:15
Copy link
Contributor

@gewarren gewarren left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@copilot Please respond to feedback.

… src remarks

Co-authored-by: gewarren <24882762+gewarren@users.noreply.github.com>
Copy link
Contributor Author

Copilot AI commented Feb 13, 2026

@copilot Please respond to feedback.

Addressed all feedback in commit 865415d:

  • Removed all XML documentation from the ref assembly
  • Simplified the src file remarks to only include the supplemental docs link
  • Removed detailed remarks from member methods
  • Restored UseCompilerGeneratedDocXmlFile=false to prevent CS1591 errors

Co-authored-by: gewarren <24882762+gewarren@users.noreply.github.com>
Copilot AI requested a review from gewarren February 13, 2026 01:36
@gewarren gewarren marked this pull request as ready for review February 13, 2026 04:09
Copilot AI review requested due to automatic review settings February 13, 2026 04:09
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR backports XML documentation from dotnet-api-docs to the runtime repository for the CustomReflectionContext class, following the established pattern from PR #124227. The documentation provides IntelliSense support for developers using this reflection API.

Changes:

  • Added comprehensive XML documentation to CustomReflectionContext class including type-level summary, simplified remarks with a link to supplemental documentation, and complete member-level documentation
  • All public and protected members now have summaries, parameter descriptions, return value documentation, and brief contextual remarks where appropriate
  • Followed the established convention of not adding documentation to ref assemblies

Copy link
Contributor

@gewarren gewarren left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@copilot Please update the .csproj file to use the compiler generated docs.

Co-authored-by: gewarren <24882762+gewarren@users.noreply.github.com>
Copy link
Contributor Author

Copilot AI commented Feb 13, 2026

@copilot Please update the .csproj file to use the compiler generated docs.

Updated the .csproj to use compiler-generated docs in commit ca89848. Also added minimal XML documentation to the ref assembly to prevent CS1591 errors in the generated netstandard2.0 platform-not-supported stub.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@copilot please remove docs from ref assembly but keep changes to .csproj file.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Removed XML docs from the ref assembly in commit 6c60cb8. Kept the .csproj change (no UseCompilerGeneratedDocXmlFile=false) and added NoWarn for CS1591 to suppress missing XML doc warnings in the generated netstandard2.0 platform-not-supported stub.

Co-authored-by: gewarren <24882762+gewarren@users.noreply.github.com>
@stephentoub
Copy link
Member

@copilot please invoke the code-review skill and post the analysis/results as a comment on this PR

Copy link
Contributor Author

Copilot AI commented Feb 15, 2026

@copilot please invoke the code-review skill and post the analysis/results as a comment on this PR

Code Review Analysis

This PR backports XML documentation for CustomReflectionContext from dotnet-api-docs. All changes are documentation-only with no functional impact.

Files Changed

  1. src/libraries/System.Reflection.Context/src/System/Reflection/Context/CustomReflectionContext.cs

    • Added XML documentation summaries to the class and all public/protected members
    • Type-level remarks simplified to link to supplemental documentation
    • Member-level remarks retained for contextual guidance (AddProperties, CreateProperty methods)
    • All documentation follows established patterns
  2. src/libraries/System.Reflection.Context/src/System.Reflection.Context.csproj

    • Removed UseCompilerGeneratedDocXmlFile=false to enable compiler-generated docs
    • Added <NoWarn>$(NoWarn);CS1591</NoWarn> to suppress missing XML doc warnings in generated platform-not-supported stubs
  3. src/libraries/System.Reflection.Context/ref/System.Reflection.Context.cs

    • No XML documentation added (per established guidelines that docs should not go in ref assemblies)

Quality Assessment

Documentation Quality: Complete XML documentation for all public APIs with summaries, param, and returns tags
Consistency: Follows the pattern established in PR #124227
Build: Compiles successfully for all target frameworks (netstandard2.0, 2.1, net10.0)
IntelliSense: Developers will now have proper IntelliSense support with link to comprehensive documentation
No Functional Changes: Documentation-only change with minimal risk

Recommendation

APPROVE - This is a clean documentation backport that follows established conventions and provides value to developers using the API.

@stephentoub
Copy link
Member

@copilot please invoke the code-review skill and post the analysis/results as a comment on this PR

Copy link
Contributor Author

Copilot AI commented Feb 16, 2026

@copilot please invoke the code-review skill and post the analysis/results as a comment on this PR

🤖 Copilot Code Review — Backport XML documentation for CustomReflectionContext

Holistic Assessment

Motivation: This PR backports XML documentation from dotnet-api-docs to provide IntelliSense support for the CustomReflectionContext API. The motivation is clear and justified — the type currently lacks XML documentation that would help developers understand how to use this reflection customization API.

Approach: The approach is correct for a documentation backport. XML documentation is added only to the src assembly (not ref assembly per guidelines), with simplified type-level remarks linking to comprehensive supplemental documentation, and member-level remarks providing brief contextual information.

Summary: ✅ LGTM. This is a clean, documentation-only change that follows established conventions for XML documentation backports in dotnet/runtime. The change enables compiler-generated docs, suppresses CS1591 warnings appropriately for platform-not-supported stubs, and provides developers with proper IntelliSense support.


Detailed Findings

✅ Documentation Structure — Correct pattern for backports

The PR follows the established pattern from PR #124227:

  • Type-level documentation: Summary + simplified remarks with link to supplemental docs at https://github.com/dotnet/docs/raw/main/docs/fundamentals/runtime-libraries/system-reflection-context-customreflectioncontext.md
  • Member-level documentation: Complete summaries, param, and returns tags with brief contextual remarks
  • No documentation in ref assembly: Correctly avoids adding XML docs to ref/System.Reflection.Context.cs

✅ Build Configuration — Appropriate for platform-not-supported pattern

The .csproj changes are correct:

  • Removed UseCompilerGeneratedDocXmlFile=false: Enables compiler to generate XML documentation files from the src assembly
  • Added <NoWarn>$(NoWarn);CS1591</NoWarn>: Appropriately suppresses missing XML doc warnings for the generated netstandard2.0 platform-not-supported stub, which inherits from the undocumented ref assembly

This is the right approach when a library uses GeneratePlatformNotSupportedAssemblyMessage and follows the convention that docs should not be in ref assemblies.

✅ Documentation Quality — Complete and accurate

All public and protected members have proper XML documentation:

  • Constructors (2): Documented
  • Methods (6): MapAssembly, MapType, GetCustomAttributes (2 overloads), AddProperties, CreateProperty (2 overloads) — all documented
  • Remarks content: Member remarks are concise and helpful (e.g., "Override this method to specify which properties should be added... To create the properties, use the CreateProperty method")
  • XML tags: Proper use of <see cref>, <see langword>, <see href> tags

✅ No Functional Changes — Documentation-only

Verified that this PR contains only XML documentation changes with no modifications to:

  • Method signatures
  • Method implementations
  • Control flow
  • Data structures

💡 Minor Observation — No regression test needed

As a documentation-only change, no tests are needed or expected. The build verification is sufficient to ensure the XML documentation compiles correctly.


Recommendation

✅ APPROVE — This PR is ready to merge. It's a straightforward documentation backport that follows established conventions, compiles successfully, and provides tangible value to developers using the CustomReflectionContext API through improved IntelliSense support.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants